/**
 * 学生实体类
 * 功能：定义学生数据结构（学号、姓名、年龄、住址），提供属性访问和修改方法
 * 重写toString()方法用于格式化输出学生信息
 */

public class Student {
    // 定义学生类
    private String id;
    private String name;
    private int age;
    private String address;

    // 构造函数，初始化学生对象
    public Student(String id, String name, int age, String address) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.address = address;
    }

    //设置学生信息
    public String getId() { return id; }

    public String getName() { return name; }

    public void setName(String name) { this.name = name; }

    public int getAge() { return age; }

    public void setAge(int age) { this.age = age; }

    public String getAddress() { return address; }

    public void setAddress(String address) { this.address = address; }

    // 覆盖toString方法，返回学生信息的字符串表示
    @Override
    public String toString() {
        return "学号：" + id + "，姓名：" + name + "，年龄：" + age + "，住址：" + address;
    }
}
